import React from 'react'
import { Table, Tag, Space,Pagination } from 'antd';
import {PLATFORM_NUMBER} from "../../../enum"
import {connect} from 'dva';
@connect(({cooperativeStore})=>({
  list: cooperativeStore.list,
  BasicInfoId:cooperativeStore.BasicInfoId
}))

class ListSubTable extends React.Component{

  state = {
    priceList:[],
  };
  componentDidMount(){
    const { dispatch } = this.props;

    // const paramsString = location.search.slice(1);
    // const searchParams = new URLSearchParams(paramsString)
    // const BasicInfoId = searchParams.get('BasicInfoId')  

    dispatch({
        type: 'cooperativeStore/queryPriceBreakdown',
        payload:{
            data:{
              "platform": PLATFORM_NUMBER.SUPPLIER_USER,
              "supplierShopId":2
              }
        }
    }).then(res => {
        if(res.code==200){
          console.log("价格明细内容",res)
            this.setState({
              priceList:res.data.querySupplierShopPriceDtoList,
            })
        }
    });
}

    render(){
      const {priceList}=this.state;
        const columns = [
            {
              title: '分区/重量段(kg)',
              dataIndex: 'typeId',
            //   render: text => <a>{text}</a>,
            },
            {
              title: '最低价格',
              className: 'column-money',
              dataIndex: 'minimumCharge',
              align: 'center'
            },
            {
              title: '0-100(单价)',
              dataIndex: 'unitPriceOne',
              align: 'center'
            },
            {
              title: '100-200(单价)',
              dataIndex: 'unitPriceTwo',
              align: 'center'
            },{
              title: '200-300(单价)',
              dataIndex: 'unitPriceThree',
              align: 'center'
            },
            {
                title: '300-500(单价)',
                dataIndex: 'unitPriceFour',
                align: 'center'
              },
              {
                title: '500-1000(单价)',
                dataIndex: 'unitPriceFive',
                align: 'center'
              },
              {
                title: '1000以上(单价)',
                dataIndex: 'unitPriceSix',
                align: 'center'
              },{
                title: '服务时效(小时)',
                dataIndex: 'servicePrescription',
                align: 'center'
              },{
                title: '响应时效(小时)',
                dataIndex: 'responseEffectiveness',
                align: 'center'
              },
          ];
        return(
            <div>
                <Table columns={columns} dataSource={priceList} bordered />
            </div>
        )

    }
}
export default ListSubTable